﻿Public Class frmAbstractFactory

    Dim Gui As GUIFactory

    Private Sub frmAbstractFactory_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Output.Print("-------------------------")
        Output.Print("--Patrón Abstract Factory:")
    End Sub

    Private Sub btnWeb_Click(sender As System.Object, e As System.EventArgs) Handles btnWeb.Click
        Gui = New GUIWebFactory()
        Output.Print("Dibujando controles Web")
        DibujarControles()
    End Sub

    Private Sub btnWin_Click(sender As System.Object, e As System.EventArgs) Handles btnWin.Click
        Gui = New GUIWinFactory()
        Output.Print("Dibujando controles Windows")
        DibujarControles()
    End Sub

    Private Sub DibujarControles()
        Dim btn As Button = Gui.CreateButton()
        Dim txt As Text = Gui.CreateTextBox()
        btn.Paint()
        txt.Paint()
    End Sub

End Class